/*
 * Arm SCP/MCP Software
 * Copyright (c) 2023-2024, Arm Limited and Contributors. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#ifndef CONFIG_FCH_H
#define CONFIG_FCH_H

#include <mod_transport.h>

#include <fwk_id.h>
#include <fwk_macros.h>

#define SCP_SCMI_FAST_CHANNEL_BASE   0x80000000
#define SCP_SYSTEM_ACCESS_PORT1_BASE 0xA0000000

#define FAKE_FCH0_AP_ADDRESS  0xFFFF0000FFFF0000
#define FAKE_FCH0_SCP_ADDRESS 0xABCD0000ABCD0000

#define FC_LEVEL_SET(PERF_IDX) \
    (SCP_SCMI_FAST_CHANNEL_BASE + \
     MOD_SCMI_PERF_FAST_CHANNEL_OFFSET_LEVEL_SET + \
     (MOD_SCMI_PERF_FAST_CHANNEL_OFFSET_TOTAL * PERF_IDX))

#define FC_LIMIT_SET(PERF_IDX) \
    (SCP_SCMI_FAST_CHANNEL_BASE + \
     MOD_SCMI_PERF_FAST_CHANNEL_OFFSET_LIMIT_SET + \
     (MOD_SCMI_PERF_FAST_CHANNEL_OFFSET_TOTAL * PERF_IDX))

#define FC_LEVEL_GET(PERF_IDX) \
    (SCP_SCMI_FAST_CHANNEL_BASE + \
     MOD_SCMI_PERF_FAST_CHANNEL_OFFSET_LEVEL_GET + \
     (MOD_SCMI_PERF_FAST_CHANNEL_OFFSET_TOTAL * PERF_IDX))

#define FC_LIMIT_GET(PERF_IDX) \
    (SCP_SCMI_FAST_CHANNEL_BASE + \
     MOD_SCMI_PERF_FAST_CHANNEL_OFFSET_LIMIT_GET + \
     (MOD_SCMI_PERF_FAST_CHANNEL_OFFSET_TOTAL * PERF_IDX))

#define FC_LEVEL_SET_AP(PERF_IDX) \
    (SCP_SCMI_FAST_CHANNEL_BASE + \
     MOD_SCMI_PERF_FAST_CHANNEL_OFFSET_LEVEL_SET + \
     (MOD_SCMI_PERF_FAST_CHANNEL_OFFSET_TOTAL * PERF_IDX) - \
     SCP_SYSTEM_ACCESS_PORT1_BASE)

#define FC_LIMIT_SET_AP(PERF_IDX) \
    (SCP_SCMI_FAST_CHANNEL_BASE + \
     MOD_SCMI_PERF_FAST_CHANNEL_OFFSET_LIMIT_SET + \
     (MOD_SCMI_PERF_FAST_CHANNEL_OFFSET_TOTAL * PERF_IDX) - \
     SCP_SYSTEM_ACCESS_PORT1_BASE)

#define FC_LEVEL_GET_AP(PERF_IDX) \
    (SCP_SCMI_FAST_CHANNEL_BASE + \
     MOD_SCMI_PERF_FAST_CHANNEL_OFFSET_LEVEL_GET + \
     (MOD_SCMI_PERF_FAST_CHANNEL_OFFSET_TOTAL * PERF_IDX) - \
     SCP_SYSTEM_ACCESS_PORT1_BASE)

#define FC_LIMIT_GET_AP(PERF_IDX) \
    (SCP_SCMI_FAST_CHANNEL_BASE + \
     MOD_SCMI_PERF_FAST_CHANNEL_OFFSET_LIMIT_GET + \
     (MOD_SCMI_PERF_FAST_CHANNEL_OFFSET_TOTAL * PERF_IDX) - \
     SCP_SYSTEM_ACCESS_PORT1_BASE)

#endif /* CONFIG_FCH_H */
